<?php 
require 'kernel/common.php';
if(!$Session->check_admin()) redirect('index.php');

if(!$id = retrieve('GET', 'agence_id', true)) redirect('agence.php?error=no_agence_select');
    
if(! is_numeric($id) ) redirect('agence.php?error=error_select');

$Agence = $db->sql_query("SELECT * FROM immo_agence WHERE id = '". $id ."'", 'ARRAY');

if($db->nb_resultat == 0)
    redirect('agence.php?error=agence_not_exist');

// Affichage du formulaire

$smarty->assign('lang', $lang);
$smarty->assign('Agence', $Agence);
$smarty->assign('token', $_SESSION['token']);

$smarty->display('agence_edition.tpl');

require 'footer.php';

?>